<?php
require_once("../TestingBootstrap.php");

/**
 * GameEng Unit Test
 *
 * @author mpike
 */
class GameEngTest extends UnitTest{

	/**
	 * Initialise any required test variables
	 */
	public function setUp(){
		$this->bootstrap = TestingBootstrap::getInstance();
	}

	/**
	 * Remove any added test data
	 */
	public function tearDown(){

	}

	public function testLoadFrontEndAction(){
		// Page Load Test
		$result = $this->bootstrap->dispatchRequest(array("c"=>"GameEng","a"=>"loadFrontEnd"));
		$this->assertContains("</html>",$result);
	}

	public function testConnectAsHostAction(){
		$result = $this->bootstrap->dispatchRequest(array("c"=>"GameEng","a"=>"connectAsHost"));
		$this->assertType("array",$result);
		$this->assertArrayHasKey("units",$result);
		$this->assertArrayHasKey("players",$result);
		$this->markTestIncomplete(); // @todo these tests should only pass with user/initialisation data
	}

	public function testConnectAsJoinAction(){
		$result = $this->bootstrap->dispatchRequest(array("c"=>"GameEng","a"=>"connectAsJoin","B"=>1));
		$this->assertType("array",$result);
		$this->assertArrayHasKey("p",$result);
	}
}